Ext.extend(avatar.module, {
	init : function() {

		this.tabpanel.add(
		  {
			xtype:'panel',
		    id:'saleprocess',
            title: '销售单',
            iconCls: 'tabs',
            closable:true,
            border: false,
			layout:'border',
			
			defaults: {
				//collapsible: true,
				split: true
			},
			items: [{
                xtype: 'tabpanel',
				title: '货运调度',
				region: 'south',
				border: false,
				height: 180,
				cmargins: '2 0 0 0',
				activeTab: 0,
				items:[{title: '车#1', html: '货运事务条目'}, {title: '车#2'}]
			},{
				xtype: 'saleitemseditorgrid',
             
				id: 'sale-details-grid',				
				title: '产品明细',
				region:'east',
				margins: '2 0 0 0',
				cmargins: '2 2 0 0',
				width: 200
			    
			},{
				xtype:'salesgrid',
				id: 'sales-grid',
				collapsible: false,
				region:'center',
				margins: '2 0 0 0',
				listeners : {
                   'saleselectionchange' : function(id, state){
                       var detailsPnl = Ext.getCmp('sale-details-grid');
                       detailsPnl.setSaleState(state);
				   }
				}

			}]
	
          }).show();
	}
});

